package com.hy.erp.inventory.pojo ;

import javax.persistence.Column ;
import javax.persistence.Entity ;
import javax.persistence.FetchType ;
import javax.persistence.NamedQueries ;
import javax.persistence.NamedQuery ;
import javax.persistence.OneToOne ;
import javax.persistence.Table ;


import com.hy.erp.inventory.dao.interfaces.IInventoryDao;
import com.hy.erp.inventory.pojo.interfaces.IInventory;
import com.hy.erp.inventory.pojo.interfaces.IMateriel;
import com.hy.mydesktop.shared.persistence.domain.gxt.MyBaseModel;
//import com.hy.erp.inventory.vsoft.libra.enterprise.framework.persistence.api.annotation.DaoA;
//import com.hy.erp.inventory.vsoft.libra.enterprise.framework.persistence.entity.AbstractPersistentEntity;

/*@Name("inventory")
@ DaoA ( IInventoryDao.class )
@ Entity
@ Table ( name = "inventory" )
@ NamedQueries (
	{
		@ NamedQuery ( name = "inventoryamount" , query = "SELECT"
															+ " inventory"
															+ " FROM"
															+ " com.pojo.Inventory inventory"
															+ " WHERE"
															+ " inventory.materiel.identifier = :identifier"
															

		),
//		@ NamedQuery ( name = "updateinventoryamount" , query = "UPDATE"
//			+ " com.pojo.Inventory inventory "
//			+ " SET"
//			+ " inventory.onHandAmount=:value"
//			+ " WHERE"
//			+ " inventory.identifier = :identifier"
//			
//
//),
//	@ NamedQuery ( name = "selectInventoryByMaterielID" , query = "SELECT"
//		+ " inventory"
//		+ " FROM"
//		+ " com.pojo.Inventory inventory WHERE inventory.materiel.identifier IN ("
//		+ " SELECT"
//		+ " checkAssist.materiel.identifier"
//		+ " FROM"
//		+ " com.pojo.check.CheckAssist checkAssist"
//		+ " WHERE"
//		+ " checkAssist.identifier = :checkAssistidentifier )"
//
//),
@NamedQuery(name="Inventory.findByInventoryId",query="from Inventory i where i.materiel.identifier=?")

	
	} )
	
	
	
*/
//	public class Inventory	extends	AbstractPersistentEntity	implements	IInventory
public class Inventory extends MyBaseModel //implements IPositonType
{
	/**
	 * <ul>
	 * <li>开发作者：李冰</li>
	 * <li>设计日期：2010-11-9；时间：下午04:21:41</li>
	 * <li>字段类型：long；字段名称：serialVersionUID</li>
	 * <li>设计目的：</li>
	 * </ul>
	 * <ul>
	 * <b>修订编号：</b>
	 * <li>修订日期：</li>
	 * <li>修订作者：</li>
	 * <li>修订原因：</li>
	 * <li>修订内容：</li>
	 * </ul>
	 */
	private static final long	serialVersionUID	=
														- 3113799646292191888L ;

	@ Column ( name = "onOrderAmount" , length = 50 )
	public Integer getOnOrderAmount ( )
	{
		return this
					.get ( IInventory.ON_ORDER_AMOUNT ) ;
	}

	public void setOnOrderAmount (
									Integer onOrderAmount )
	{
		super
				.set (
						IInventory.ON_ORDER_AMOUNT ,
						onOrderAmount ) ;
	}

	@ Column ( name = "onHandAmount" , length = 50 )
	public Integer getOnHandAmount ( )
	{
		return this
					.get ( IInventory.ON_HAND_AMOUNT ) ;
	}

	public void setOnHandAmount (
									Integer onHandAmount )
	{
		super
				.set (
						IInventory.ON_HAND_AMOUNT ,
						onHandAmount ) ;
	}

	@ Column ( name = "sum" , length = 50 )
	public Integer getNumber ( )
	{
		return this
					.get ( IInventory.SUM ) ;
	}

	public void setNumber (
							Integer sum )
	{
		super
				.set (
						IInventory.SUM ,
						sum ) ;
	}

	@ OneToOne ( targetEntity = Materiel.class , fetch = FetchType.LAZY )
	public IMateriel getMateriel ( )
	{
		return this
					.get ( IInventory.MATERIEL ) ;
	}

	public void setMateriel (
								IMateriel materiel )
	{
		super
				.set (
						IInventory.MATERIEL ,
						materiel ) ;
	}
}
